package com.woniuxy.controller;

import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.SaleCountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Leimin
 * @date 2022/04/26 19:09
 **/
@RestController
@RequestMapping("/saleCount")
@Api(tags = "销售统计接口")
public class SaleCountController {
    @Autowired
    private SaleCountService saleCountService;

    @GetMapping("/month")
    @ApiOperation(value = "获取近一年分月销售数据")
    public ResponseEntity countByMonth(){
        return saleCountService.countByMonth();
    }

    @GetMapping("/order_status")
    @ApiOperation(value = "获取近一年订单状态统计")
    public ResponseEntity countOrder_status(){
        return saleCountService.countOrder_status();
    }

    @GetMapping("/product_type")
    @ApiOperation(value = "获取近一年销售商品类型统计")
    public ResponseEntity countProduct_type(){
        return saleCountService.countProduct_type();
    }
}

